package cn.royan.fl.events 
{
	import flash.events.Event;
	
	/**
	 * ...
	 * @author RoYan
	 */
	public class SocketEvent extends Event 
	{
		public static const SOCKET_CONNECT:String 	= "socket_connect";
		public static const SOCKET_PACKET:String	= "socket_packet";
		public static const SOCKET_CLOSE:String		= "socket_close";
		public static const SOCKET_ERROR:String 	= "socket_eror";
		
		private var _type:String;
		private var _bubbles:Boolean;
		private var _cancelable:Boolean;
		private var _data:*;
		
		public function SocketEvent( type:String, data:* = null, bubbles:Boolean = false, cancelable:Boolean = false ) 
		{
			super( type, bubbles, cancelable );
            _type 		= type;
			_bubbles 	= bubbles;
			_cancelable = cancelable;
			_data 		= data;
		}
		
		public override function clone():Event
        {
            return new SocketEvent( _type, _data, _bubbles, _cancelable );
        }
		
		public function get data():*
		{
			return _data;
		}
	}

}